package top.boycharse.talker.service;

import top.boycharse.talker.bean.db.User;

import javax.ws.rs.core.Context;
import javax.ws.rs.core.SecurityContext;

public class BaseService {

    // 添加一个上下文注解
    @Context
    protected SecurityContext securityContext;

    protected User getSelf() {
        return (User) securityContext.getUserPrincipal();
    }
}
